package com.reader.cms.entity.sys;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.reader.core.validator.group.AddGroup;
import com.reader.core.validator.group.UpdateGroup;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

/**
 *
 * @@description
 * @author        jiahaikun
 * @date          2018-09-25
 */

@TableName("sys_message")
public class SysMessage extends Model<SysMessage> {

	private static final long serialVersionUID = 1L;



	@TableId(value="id", type= IdType.AUTO)


	private Integer id;

	@NotBlank(message="状态码不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Size(max = 10,message = "状态码长度不能超过10", groups = {AddGroup.class, UpdateGroup.class})
	private String code;

	@NotBlank(message="状态信息不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Size(max = 80,message = "状态信息长度不能超过80", groups = {AddGroup.class, UpdateGroup.class})
	private String message;



	private Integer enable;


	@TableField("del_flag")
	private Integer delFlag;



	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@TableField("insert_dt")
	private Date insertDt;



	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@TableField("updt_dt")
	private Date updtDt;


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Integer  getEnable() {
		return enable;
	}

	public void setEnable(Integer enable) {
		this.enable = enable;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	public Date getInsertDt() {
		return insertDt;
	}

	public void setInsertDt(Date insertDt) {
		this.insertDt = insertDt;
	}

	public Date getUpdtDt() {
		return updtDt;
	}

	public void setUpdtDt(Date updtDt) {
		this.updtDt = updtDt;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "SysMessage{" +
				", id=" + id +
				", code=" + code +
				", message=" + message +
				", enable=" + enable +
				", delFlag=" + delFlag +
				", insertDt=" + insertDt +
				", updtDt=" + updtDt +
				"}";
	}
}